var CheckerMaterial = function(scale, reflectiveness) {
	this.scale = scale;
	this.reflectiveness = reflectiveness;
};

CheckerMaterial.prototype.sample = function(ray, position, normal) {
	return Math.abs((Math.floor(position.x * this.scale) + Math.floor(position.z * this.scale)) % 2) < 1 ? Color.black : Color.white;
};

var PhoneMaterial = function(diffuse, specular, shininess, reflectiveness) {
	this.diffuse = diffuse;
	this.specular = specular;
	this.shininess = shininess;
	this.reflectiveness = reflectiveness;
};

PhoneMaterial.prototype.sample = function(ray, position, normal) {
	var NdotL = normal.dot(lightDir);
	var H = (lightDir.subtract(ray.direction)).normalize();
	var NdotH = normal.dot(H);
	var diffuseTemp = this.diffuse.multiply(Math.max(NdotL, 0));
	var specularTemp = this.specular.multiply(Math.pow(Math.max(NdotH), this.shininess));
	return lightColor.modulate(diffuseTemp.add(specularTemp));
};